import Cookies from 'js-cookie'

const TokenKey = 'Admin-Token'
const ExpiresInKey = 'Admin-Expires-In'
const EnterpriseCodeKey ='enterprise_code'
const ApplicaitonCodeKey='application_code'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}

export function getExpiresIn() {
  return Cookies.get(ExpiresInKey) || -1
}

export function setExpiresIn(time) {
  return Cookies.set(ExpiresInKey, time)
}

export function removeExpiresIn() {
  return Cookies.remove(ExpiresInKey)
}
export function getEnterpriseCode() {
  return Cookies.get(EnterpriseCodeKey)
}

export function setEnterpriseCode(enterpriseCode) {
  return Cookies.set(EnterpriseCodeKey, enterpriseCode)
}
export function getApplicaitonCode() {
  return Cookies.get(ApplicaitonCodeKey)
}

export function setApplicaitonCode(applicationCode) {
  return Cookies.set(ApplicaitonCodeKey, applicationCode)
}
